package com.acme.bankapp.domain.bank.exception;

/**
 * @author Alexander Kotov (kotov.alex.22@gmail.com)
 */
public class InvalidAccountException extends BankException {
    private final int id;
    private final String clientName;

    public InvalidAccountException(int id, String clientName) {
        this.id = id;
        this.clientName = clientName;
    }

    public InvalidAccountException(String message, int id, String clientName) {
        super(message);
        this.id = id;
        this.clientName = clientName;
    }

    public InvalidAccountException(String message, Throwable cause, int id, String clientName) {
        super(message, cause);
        this.id = id;
        this.clientName = clientName;
    }

    public InvalidAccountException(Throwable cause, int id, String clientName) {
        super(cause);
        this.id = id;
        this.clientName = clientName;
    }

    @Override
    public String getMessage() {
        return "Client " +  clientName + " doesn't have account with id = " + id;
    }
}
